package com.hand.exam.service.impl;

import com.hand.exam.domain.Mattersave;
import com.hand.exam.mapper.MatterMapper;
import com.hand.exam.mapper.MattersaveMapper;
import com.hand.exam.service.IMattersaveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 马旭阳
 * @date2019/7/20
 */
@Service
public class MattersaveServiceImpl implements IMattersaveService {
    @Autowired
    private MattersaveMapper mattersaveMapper;

    @Override
    public void updateMattersave(Long mid, Long sid, Long number) {
        mattersaveMapper.updateMattersave(mid,sid,number);
    }

    @Override
    public void updateMattersaveBynumber(Long mid, Long sid, Long number) {

        mattersaveMapper.updateMattersaveBynumber(mid,sid,number);
    }

    @Override
    public List<Mattersave> queryMattersaveByMid(Long mid) {
        return mattersaveMapper.queryMattersaveByMid(mid);
    }

    @Override
    public List<Mattersave> queryMattersaveByNumber(Long number) {
        return mattersaveMapper.queryMattersaveByNumber(number);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteMattersave(Long id) {
        mattersaveMapper.deleteMattersave(id);
    }

    @Override
    public Mattersave queryBySid(Long mid, Long sid) {
        return mattersaveMapper.queryBySid(mid,sid);
    }

    @Override
    public void insertMattersave(Mattersave mattersave) {
        mattersaveMapper.insertMattersave(mattersave);
    }
}
